!(function(e, t) { "object" == typeof exports && "undefined" != typeof module ? (module.exports = t()) : "function" == typeof define && define.amd ? define(t) : ((e = e || self).GLightbox = t()); })(this, function() { "use strict"; function e(t) { return (e = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) { return typeof e; } : function(e) { return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e; })(t); } function t(e, t) { if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function"); } function i(e, t) { for (var i = 0; i < t.length; i++) { var n = t[i]; (n.enumerable = n.enumerable || !1), (n.configurable = !0), "value" in n && (n.writable = !0), Object.defineProperty(e, n.key, n); } } function n(e, t, n) { return t && i(e.prototype, t), n && i(e, n), e; } var s = Date.now(); function l() { var e = {}, t = !0, i = 0, n = arguments.length; "[object Boolean]" === Object.prototype.toString.call(arguments[0]) && ((t = arguments[0]), i++); for ( var s = function(i) { for (var n in i) Object.prototype.hasOwnProperty.call(i, n) && (t && "[object Object]" === Object.prototype.toString.call(i[n]) ? (e[n] = l(!0, e[n], i[n])) : (e[n] = i[n])); }; i < n; i++ ) { var o = arguments[i]; s(o); } return e; } function o(e, t) { if ( ((k(e) || e === window || e === document) && (e = [e]), A(e) || L(e) || (e = [e]), 0 != P(e)) ) if (A(e) && !L(e)) for ( var i = e.length, n = 0; n < i && !1 !== t.call(e[n], e[n], n, e); n++ ); else if (L(e)) for (var s in e) if (O(e, s) && !1 === t.call(e[s], e[s], s, e)) break; } function r(e) { var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null, i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : null, n = (e[s] = e[s] || []), l = { all: n, evt: null, found: null }; return ( t && i && P(n) > 0 && o(n, function(e, n) { if (e.eventName == t && e.fn.toString() == i.toString()) return (l.found = !0), (l.evt = n), !1; }), l ); } function a(e) { var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, i = t.onElement, n = t.withCallback, s = t.avoidDuplicate, l = void 0 === s || s, a = t.once, h = void 0 !== a && a, d = t.useCapture, c = void 0 !== d && d, u = arguments.length > 2 ? arguments[2] : void 0, g = i || []; function v(e) { T(n) && n.call(u, e, this), h && v.destroy(); } return ( C(g) && (g = document.querySelectorAll(g)), (v.destroy = function() { o(g, function(t) { var i = r(t, e, v); i.found && i.all.splice(i.evt, 1), t.removeEventListener && t.removeEventListener(e, v, c); }); }), o(g, function(t) { var i = r(t, e, v); ((t.addEventListener && l && !i.found) || !l) && (t.addEventListener(e, v, c), i.all.push({ eventName: e, fn: v })); }), v ); } function h(e, t) { o(t.split(" "), function(t) { return e.classList.add(t); }); } function d(e, t) { o(t.split(" "), function(t) { return e.classList.remove(t); }); } function c(e, t) { return e.classList.contains(t); } function u(e, t) { for (; e !== document.body;) { if (!(e = e.parentElement)) return !1; if ( "function" == typeof e.matches ? e.matches(t) : e.msMatchesSelector(t) ) return e; } } function g(e) { var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : "", i = arguments.length > 2 && void 0 !== arguments[2] && arguments[2]; if (!e || "" === t) return !1; if ("none" == t) return T(i) && i(), !1; var n = x(), s = t.split(" "); o(s, function(t) { h(e, "g" + t); }), a(n, { onElement: e, avoidDuplicate: !1, once: !0, withCallback: function(e, t) { o(s, function(e) { d(t, "g" + e); }), T(i) && i(); }, }); } function v(e) { var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : ""; if ("" == t) return ( (e.style.webkitTransform = ""), (e.style.MozTransform = ""), (e.style.msTransform = ""), (e.style.OTransform = ""), (e.style.transform = ""), !1 ); (e.style.webkitTransform = t), (e.style.MozTransform = t), (e.style.msTransform = t), (e.style.OTransform = t), (e.style.transform = t); } function f(e) { e.style.display = "block"; } function p(e) { e.style.display = "none"; } function m(e) { var t = document.createDocumentFragment(), i = document.createElement("div"); for (i.innerHTML = e; i.firstChild;) t.appendChild(i.firstChild); return t; } function y() { return { width: window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth, height: window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight, }; } function x() { var e, t = document.createElement("fakeelement"), i = { animation: "animationend", OAnimation: "oAnimationEnd", MozAnimation: "animationend", WebkitAnimation: "webkitAnimationEnd", }; for (e in i) if (void 0 !== t.style[e]) return i[e]; } function b(e, t, i, n) { if (e()) t(); else { var s; i || (i = 100); var l = setInterval(function() { e() && (clearInterval(l), s && clearTimeout(s), t()); }, i); n && (s = setTimeout(function() { clearInterval(l); }, n)); } } function S(e, t, i) { if (I(e)) console.error("Inject assets error"); else if ((T(t) && ((i = t), (t = !1)), C(t) && t in window)) T(i) && i(); else { var n; if (-1 !== e.indexOf(".css")) { if ( (n = document.querySelectorAll('link[href="' + e + '"]')) && n.length > 0 ) return void(T(i) && i()); var s = document.getElementsByTagName("head")[0], l = s.querySelectorAll('link[rel="stylesheet"]'), o = document.createElement("link"); return ( (o.rel = "stylesheet"), (o.type = "text/css"), (o.href = e), (o.media = "all"), l ? s.insertBefore(o, l[0]) : s.appendChild(o), void(T(i) && i()) ); } if ( (n = document.querySelectorAll('script[src="' + e + '"]')) && n.length > 0 ) { if (T(i)) { if (C(t)) return ( b( function() { return void 0 !== window[t]; }, function() { i(); } ), !1 ); i(); } } else { var r = document.createElement("script"); (r.type = "text/javascript"), (r.src = e), (r.onload = function() { if (T(i)) { if (C(t)) return ( b( function() { return void 0 !== window[t]; }, function() { i(); } ), !1 ); i(); } }), document.body.appendChild(r); } } } function w() { return ( "navigator" in window && window.navigator.userAgent.match( /(iPad)|(iPhone)|(iPod)|(Android)|(PlayBook)|(BB10)|(BlackBerry)|(Opera Mini)|(IEMobile)|(webOS)|(MeeGo)/i ) ); } function T(e) { return "function" == typeof e; } function C(e) { return "string" == typeof e; } function k(e) { return !(!e || !e.nodeType || 1 != e.nodeType); } function E(e) { return Array.isArray(e); } function A(e) { return e && e.length && isFinite(e.length); } function L(t) { return "object" === e(t) && null != t && !T(t) && !E(t); } function I(e) { return null == e; } function O(e, t) { return null !== e && hasOwnProperty.call(e, t); } function P(e) { if (L(e)) { if (e.keys) return e.keys().length; var t = 0; for (var i in e) O(e, i) && t++; return t; } return e.length; } function z(e) { return !isNaN(parseFloat(e)) && isFinite(e); } function M() { var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : -1, t = document.querySelectorAll(".gbtn[data-taborder]:not(.disabled)"); if (!t.length) return !1; if (1 == t.length) return t[0]; "string" == typeof e && (e = parseInt(e)); var i = e < 0 ? 1 : e + 1; i > t.length && (i = "1"); var n = []; o(t, function(e) { n.push(e.getAttribute("data-taborder")); }); var s = n.filter(function(e) { return e >= parseInt(i); }), l = s.sort()[0]; return document.querySelector('.gbtn[data-taborder="'.concat(l, '"]')); } function X(e) { if (e.events.hasOwnProperty("keyboard")) return !1; e.events.keyboard = a("keydown", { onElement: window, withCallback: function(t, i) { var n = (t = t || window.event).keyCode; if (9 == n) { var s = document.querySelector(".gbtn.focused"); if (!s) { var l = !(!document.activeElement || !document.activeElement.nodeName) && document.activeElement.nodeName.toLocaleLowerCase(); if ("input" == l || "textarea" == l || "button" == l) return; } t.preventDefault(); var o = document.querySelectorAll(".gbtn[data-taborder]"); if (!o || o.length <= 0) return; if (!s) { var r = M(); return void(r && (r.focus(), h(r, "focused"))); } var a = M(s.getAttribute("data-taborder")); d(s, "focused"), a && (a.focus(), h(a, "focused")); } 39 == n && e.nextSlide(), 37 == n && e.prevSlide(), 27 == n && e.close(); }, }); } function Y(e) { return Math.sqrt(e.x * e.x + e.y * e.y); } function q(e, t) { var i = (function(e, t) { var i = Y(e) * Y(t); if (0 === i) return 0; var n = (function(e, t) { return e.x * t.x + e.y * t.y; })(e, t) / i; return n > 1 && (n = 1), Math.acos(n); })(e, t); return ( (function(e, t) { return e.x * t.y - t.x * e.y; })(e, t) > 0 && (i *= -1), (180 * i) / Math.PI ); } var N = (function() { function e(i) { t(this, e), (this.handlers = []), (this.el = i); } return ( n(e, [{ key: "add", value: function(e) { this.handlers.push(e); }, }, { key: "del", value: function(e) { e || (this.handlers = []); for (var t = this.handlers.length; t >= 0; t--) this.handlers[t] === e && this.handlers.splice(t, 1); }, }, { key: "dispatch", value: function() { for (var e = 0, t = this.handlers.length; e < t; e++) { var i = this.handlers[e]; "function" == typeof i && i.apply(this.el, arguments); } }, }, ]), e ); })(); function D(e, t) { var i = new N(e); return i.add(t), i; } var _ = (function() { function e(i, n) { t(this, e), (this.element = "string" == typeof i ? document.querySelector(i) : i), (this.start = this.start.bind(this)), (this.move = this.move.bind(this)), (this.end = this.end.bind(this)), (this.cancel = this.cancel.bind(this)), this.element.addEventListener("touchstart", this.start, !1), this.element.addEventListener("touchmove", this.move, !1), this.element.addEventListener("touchend", this.end, !1), this.element.addEventListener("touchcancel", this.cancel, !1), (this.preV = { x: null, y: null }), (this.pinchStartLen = null), (this.zoom = 1), (this.isDoubleTap = !1); var s = function() {}; (this.rotate = D(this.element, n.rotate || s)), (this.touchStart = D(this.element, n.touchStart || s)), (this.multipointStart = D(this.element, n.multipointStart || s)), (this.multipointEnd = D(this.element, n.multipointEnd || s)), (this.pinch = D(this.element, n.pinch || s)), (this.swipe = D(this.element, n.swipe || s)), (this.tap = D(this.element, n.tap || s)), (this.doubleTap = D(this.element, n.doubleTap || s)), (this.longTap = D(this.element, n.longTap || s)), (this.singleTap = D(this.element, n.singleTap || s)), (this.pressMove = D(this.element, n.pressMove || s)), (this.twoFingerPressMove = D(this.element, n.twoFingerPressMove || s)), (this.touchMove = D(this.element, n.touchMove || s)), (this.touchEnd = D(this.element, n.touchEnd || s)), (this.touchCancel = D(this.element, n.touchCancel || s)), (this.translateContainer = this.element), (this._cancelAllHandler = this.cancelAll.bind(this)), window.addEventListener("scroll", this._cancelAllHandler), (this.delta = null), (this.last = null), (this.now = null), (this.tapTimeout = null), (this.singleTapTimeout = null), (this.longTapTimeout = null), (this.swipeTimeout = null), (this.x1 = this.x2 = this.y1 = this.y2 = null), (this.preTapPosition = { x: null, y: null }); } return ( n(e, [{ key: "start", value: function(e) { if (e.touches) { if ( e.target && e.target.nodeName && ["a", "button", "input"].indexOf( e.target.nodeName.toLowerCase() ) >= 0 ) console.log( "ignore drag for this touched element", e.target.nodeName.toLowerCase() ); else { (this.now = Date.now()), (this.x1 = e.touches[0].pageX), (this.y1 = e.touches[0].pageY), (this.delta = this.now - (this.last || this.now)), this.touchStart.dispatch(e, this.element), null !== this.preTapPosition.x && ((this.isDoubleTap = this.delta > 0 && this.delta <= 250 && Math.abs(this.preTapPosition.x - this.x1) < 30 && Math.abs(this.preTapPosition.y - this.y1) < 30), this.isDoubleTap && clearTimeout(this.singleTapTimeout)), (this.preTapPosition.x = this.x1), (this.preTapPosition.y = this.y1), (this.last = this.now); var t = this.preV; if (e.touches.length > 1) { this._cancelLongTap(), this._cancelSingleTap(); var i = { x: e.touches[1].pageX - this.x1, y: e.touches[1].pageY - this.y1, }; (t.x = i.x), (t.y = i.y), (this.pinchStartLen = Y(t)), this.multipointStart.dispatch(e, this.element); } (this._preventTap = !1), (this.longTapTimeout = setTimeout( function() { this.longTap.dispatch(e, this.element), (this._preventTap = !0); }.bind(this), 750 )); } } }, }, { key: "move", value: function(e) { if (e.touches) { var t = this.preV, i = e.touches.length, n = e.touches[0].pageX, s = e.touches[0].pageY; if (((this.isDoubleTap = !1), i > 1)) { var l = e.touches[1].pageX, o = e.touches[1].pageY, r = { x: e.touches[1].pageX - n, y: e.touches[1].pageY - s }; null !== t.x && (this.pinchStartLen > 0 && ((e.zoom = Y(r) / this.pinchStartLen), this.pinch.dispatch(e, this.element)), (e.angle = q(r, t)), this.rotate.dispatch(e, this.element)), (t.x = r.x), (t.y = r.y), null !== this.x2 && null !== this.sx2 ? ((e.deltaX = (n - this.x2 + l - this.sx2) / 2), (e.deltaY = (s - this.y2 + o - this.sy2) / 2)) : ((e.deltaX = 0), (e.deltaY = 0)), this.twoFingerPressMove.dispatch(e, this.element), (this.sx2 = l), (this.sy2 = o); } else { if (null !== this.x2) { (e.deltaX = n - this.x2), (e.deltaY = s - this.y2); var a = Math.abs(this.x1 - this.x2), h = Math.abs(this.y1 - this.y2); (a > 10 || h > 10) && (this._preventTap = !0); } else(e.deltaX = 0), (e.deltaY = 0); this.pressMove.dispatch(e, this.element); } this.touchMove.dispatch(e, this.element), this._cancelLongTap(), (this.x2 = n), (this.y2 = s), i > 1 && e.preventDefault(); } }, }, { key: "end", value: function(e) { if (e.changedTouches) { this._cancelLongTap(); var t = this; e.touches.length < 2 && (this.multipointEnd.dispatch(e, this.element), (this.sx2 = this.sy2 = null)), (this.x2 && Math.abs(this.x1 - this.x2) > 30) || (this.y2 && Math.abs(this.y1 - this.y2) > 30) ? ((e.direction = this._swipeDirection( this.x1, this.x2, this.y1, this.y2 )), (this.swipeTimeout = setTimeout(function() { t.swipe.dispatch(e, t.element); }, 0))) : ((this.tapTimeout = setTimeout(function() { t._preventTap || t.tap.dispatch(e, t.element), t.isDoubleTap && (t.doubleTap.dispatch(e, t.element), (t.isDoubleTap = !1)); }, 0)), t.isDoubleTap || (t.singleTapTimeout = setTimeout(function() { t.singleTap.dispatch(e, t.element); }, 250))), this.touchEnd.dispatch(e, this.element), (this.preV.x = 0), (this.preV.y = 0), (this.zoom = 1), (this.pinchStartLen = null), (this.x1 = this.x2 = this.y1 = this.y2 = null); } }, }, { key: "cancelAll", value: function() { (this._preventTap = !0), clearTimeout(this.singleTapTimeout), clearTimeout(this.tapTimeout), clearTimeout(this.longTapTimeout), clearTimeout(this.swipeTimeout); }, }, { key: "cancel", value: function(e) { this.cancelAll(), this.touchCancel.dispatch(e, this.element); }, }, { key: "_cancelLongTap", value: function() { clearTimeout(this.longTapTimeout); }, }, { key: "_cancelSingleTap", value: function() { clearTimeout(this.singleTapTimeout); }, }, { key: "_swipeDirection", value: function(e, t, i, n) { return Math.abs(e - t) >= Math.abs(i - n) ? e - t > 0 ? "Left" : "Right" : i - n > 0 ? "Up" : "Down"; }, }, { key: "on", value: function(e, t) { this[e] && this[e].add(t); }, }, { key: "off", value: function(e, t) { this[e] && this[e].del(t); }, }, { key: "destroy", value: function() { return ( this.singleTapTimeout && clearTimeout(this.singleTapTimeout), this.tapTimeout && clearTimeout(this.tapTimeout), this.longTapTimeout && clearTimeout(this.longTapTimeout), this.swipeTimeout && clearTimeout(this.swipeTimeout), this.element.removeEventListener("touchstart", this.start), this.element.removeEventListener("touchmove", this.move), this.element.removeEventListener("touchend", this.end), this.element.removeEventListener("touchcancel", this.cancel), this.rotate.del(), this.touchStart.del(), this.multipointStart.del(), this.multipointEnd.del(), this.pinch.del(), this.swipe.del(), this.tap.del(), this.doubleTap.del(), this.longTap.del(), this.singleTap.del(), this.pressMove.del(), this.twoFingerPressMove.del(), this.touchMove.del(), this.touchEnd.del(), this.touchCancel.del(), (this.preV = this.pinchStartLen = this.zoom = this.isDoubleTap = this.delta = this.last = this.now = this.tapTimeout = this.singleTapTimeout = this.longTapTimeout = this.swipeTimeout = this.x1 = this.x2 = this.y1 = this.y2 = this.preTapPosition = this.rotate = this.touchStart = this.multipointStart = this.multipointEnd = this.pinch = this.swipe = this.tap = this.doubleTap = this.longTap = this.singleTap = this.pressMove = this.touchMove = this.touchEnd = this.touchCancel = this.twoFingerPressMove = null), window.removeEventListener("scroll", this._cancelAllHandler), null ); }, }, ]), e ); })(); function W(e) { var t = (function() { var e, t = document.createElement("fakeelement"), i = { transition: "transitionend", OTransition: "oTransitionEnd", MozTransition: "transitionend", WebkitTransition: "webkitTransitionEnd", }; for (e in i) if (void 0 !== t.style[e]) return i[e]; })(), i = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth, n = c(e, "gslide-media") ? e : e.querySelector(".gslide-media"), s = u(n, ".ginner-container"), l = e.querySelector(".gslide-description"); i > 769 && (n = s), h(n, "greset"), v(n, "translate3d(0, 0, 0)"), a(t, { onElement: n, once: !0, withCallback: function(e, t) { d(n, "greset"); }, }), (n.style.opacity = ""), l && (l.style.opacity = ""); } function B(e) { if (e.events.hasOwnProperty("touch")) return !1; var t, i, n, s = y(), l = s.width, o = s.height, r = !1, a = null, g = null, f = null, p = !1, m = 1, x = 1, b = !1, S = !1, w = null, T = null, C = null, k = null, E = 0, A = 0, L = !1, I = !1, O = {}, P = {}, z = 0, M = 0, X = document.getElementById("glightbox-slider"), Y = document.querySelector(".goverlay"), q = new _(X, { touchStart: function(t) { if ( ((r = !0), (c(t.targetTouches[0].target, "ginner-container") || u(t.targetTouches[0].target, ".gslide-desc") || "a" == t.targetTouches[0].target.nodeName.toLowerCase()) && (r = !1), u(t.targetTouches[0].target, ".gslide-inline") && !c(t.targetTouches[0].target.parentNode, "gslide-inline") && (r = !1), r) ) { if ( ((P = t.targetTouches[0]), (O.pageX = t.targetTouches[0].pageX), (O.pageY = t.targetTouches[0].pageY), (z = t.targetTouches[0].clientX), (M = t.targetTouches[0].clientY), (a = e.activeSlide), (g = a.querySelector(".gslide-media")), (n = a.querySelector(".gslide-inline")), (f = null), c(g, "gslide-image") && (f = g.querySelector("img")), (window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth) > 769 && (g = a.querySelector(".ginner-container")), d(Y, "greset"), t.pageX > 20 && t.pageX < window.innerWidth - 20) ) return; t.preventDefault(); } }, touchMove: function(s) { if (r && ((P = s.targetTouches[0]), !b && !S)) { if (n && n.offsetHeight > o) { var a = O.pageX - P.pageX; if (Math.abs(a) <= 13) return !1; } p = !0; var h, d = s.targetTouches[0].clientX, c = s.targetTouches[0].clientY, u = z - d, m = M - c; if ( (Math.abs(u) > Math.abs(m) ? ((L = !1), (I = !0)) : ((I = !1), (L = !0)), (t = P.pageX - O.pageX), (E = (100 * t) / l), (i = P.pageY - O.pageY), (A = (100 * i) / o), L && f && ((h = 1 - Math.abs(i) / o), (Y.style.opacity = h), e.settings.touchFollowAxis && (E = 0)), I && ((h = 1 - Math.abs(t) / l), (g.style.opacity = h), e.settings.touchFollowAxis && (A = 0)), !f) ) return v(g, "translate3d(".concat(E, "%, 0, 0)")); v(g, "translate3d(".concat(E, "%, ").concat(A, "%, 0)")); } }, touchEnd: function() { if (r) { if (((p = !1), S || b)) return (C = w), void(k = T); var t = Math.abs(parseInt(A)), i = Math.abs(parseInt(E)); if (!(t > 29 && f)) return t < 29 && i < 25 ? (h(Y, "greset"), (Y.style.opacity = 1), W(g)) : void 0; e.close(); } }, multipointEnd: function() { setTimeout(function() { b = !1; }, 50); }, multipointStart: function() { (b = !0), (m = x || 1); }, pinch: function(e) { if (!f || p) return !1; (b = !0), (f.scaleX = f.scaleY = m * e.zoom); var t = m * e.zoom; if (((S = !0), t <= 1)) return ( (S = !1), (t = 1), (k = null), (C = null), (w = null), (T = null), void f.setAttribute("style", "") ); t > 4.5 && (t = 4.5), (f.style.transform = "scale3d(".concat(t, ", ").concat(t, ", 1)")), (x = t); }, pressMove: function(e) { if (S && !b) { var t = P.pageX - O.pageX, i = P.pageY - O.pageY; C && (t += C), k && (i += k), (w = t), (T = i); var n = "translate3d(".concat(t, "px, ").concat(i, "px, 0)"); x && (n += " scale3d(".concat(x, ", ").concat(x, ", 1)")), v(f, n); } }, swipe: function(t) { if (!S) if (b) b = !1; else { if ("Left" == t.direction) { if (e.index == e.elements.length - 1) return W(g); e.nextSlide(); } if ("Right" == t.direction) { if (0 == e.index) return W(g); e.prevSlide(); } } }, }); e.events.touch = q; } var H = (function() { function e(i, n) { var s = this, l = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : null; if ( (t(this, e), (this.img = i), (this.slide = n), (this.onclose = l), this.img.setZoomEvents) ) return !1; (this.active = !1), (this.zoomedIn = !1), (this.dragging = !1), (this.currentX = null), (this.currentY = null), (this.initialX = null), (this.initialY = null), (this.xOffset = 0), (this.yOffset = 0), this.img.addEventListener( "mousedown", function(e) { return s.dragStart(e); }, !1 ), this.img.addEventListener( "mouseup", function(e) { return s.dragEnd(e); }, !1 ), this.img.addEventListener( "mousemove", function(e) { return s.drag(e); }, !1 ), this.img.addEventListener( "click", function(e) { return s.slide.classList.contains("dragging-nav") ? (s.zoomOut(), !1) : s.zoomedIn ? void(s.zoomedIn && !s.dragging && s.zoomOut()) : s.zoomIn(); }, !1 ), (this.img.setZoomEvents = !0); } return ( n(e, [{ key: "zoomIn", value: function() { var e = this.widowWidth(); if (!(this.zoomedIn || e <= 768)) { var t = this.img; if ( (t.setAttribute("data-style", t.getAttribute("style")), (t.style.maxWidth = t.naturalWidth + "px"), (t.style.maxHeight = t.naturalHeight + "px"), t.naturalWidth > e) ) { var i = e / 2 - t.naturalWidth / 2; this.setTranslate(this.img.parentNode, i, 0); } this.slide.classList.add("zoomed"), (this.zoomedIn = !0); } }, }, { key: "zoomOut", value: function() { this.img.parentNode.setAttribute("style", ""), this.img.setAttribute( "style", this.img.getAttribute("data-style") ), this.slide.classList.remove("zoomed"), (this.zoomedIn = !1), (this.currentX = null), (this.currentY = null), (this.initialX = null), (this.initialY = null), (this.xOffset = 0), (this.yOffset = 0), this.onclose && "function" == typeof this.onclose && this.onclose(); }, }, { key: "dragStart", value: function(e) { e.preventDefault(), this.zoomedIn ? ("touchstart" === e.type ? ((this.initialX = e.touches[0].clientX - this.xOffset), (this.initialY = e.touches[0].clientY - this.yOffset)) : ((this.initialX = e.clientX - this.xOffset), (this.initialY = e.clientY - this.yOffset)), e.target === this.img && ((this.active = !0), this.img.classList.add("dragging"))) : (this.active = !1); }, }, { key: "dragEnd", value: function(e) { var t = this; e.preventDefault(), (this.initialX = this.currentX), (this.initialY = this.currentY), (this.active = !1), setTimeout(function() { (t.dragging = !1), (t.img.isDragging = !1), t.img.classList.remove("dragging"); }, 100); }, }, { key: "drag", value: function(e) { this.active && (e.preventDefault(), "touchmove" === e.type ? ((this.currentX = e.touches[0].clientX - this.initialX), (this.currentY = e.touches[0].clientY - this.initialY)) : ((this.currentX = e.clientX - this.initialX), (this.currentY = e.clientY - this.initialY)), (this.xOffset = this.currentX), (this.yOffset = this.currentY), (this.img.isDragging = !0), (this.dragging = !0), this.setTranslate(this.img, this.currentX, this.currentY)); }, }, { key: "onMove", value: function(e) { if (this.zoomedIn) { var t = e.clientX - this.img.naturalWidth / 2, i = e.clientY - this.img.naturalHeight / 2; this.setTranslate(this.img, t, i); } }, }, { key: "setTranslate", value: function(e, t, i) { e.style.transform = "translate3d(" + t + "px, " + i + "px, 0)"; }, }, { key: "widowWidth", value: function() { return ( window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth ); }, }, ]), e ); })(), V = (function() { function e() { var i = this, n = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; t(this, e); var s = n.dragEl, l = n.toleranceX, o = void 0 === l ? 40 : l, r = n.toleranceY, a = void 0 === r ? 65 : r, h = n.slide, d = void 0 === h ? null : h, c = n.instance, u = void 0 === c ? null : c; (this.el = s), (this.active = !1), (this.dragging = !1), (this.currentX = null), (this.currentY = null), (this.initialX = null), (this.initialY = null), (this.xOffset = 0), (this.yOffset = 0), (this.direction = null), (this.lastDirection = null), (this.toleranceX = o), (this.toleranceY = a), (this.toleranceReached = !1), (this.dragContainer = this.el), (this.slide = d), (this.instance = u), this.el.addEventListener( "mousedown", function(e) { return i.dragStart(e); }, !1 ), this.el.addEventListener( "mouseup", function(e) { return i.dragEnd(e); }, !1 ), this.el.addEventListener( "mousemove", function(e) { return i.drag(e); }, !1 ); } return ( n(e, [{ key: "dragStart", value: function(e) { if (this.slide.classList.contains("zoomed")) this.active = !1; else { "touchstart" === e.type ? ((this.initialX = e.touches[0].clientX - this.xOffset), (this.initialY = e.touches[0].clientY - this.yOffset)) : ((this.initialX = e.clientX - this.xOffset), (this.initialY = e.clientY - this.yOffset)); var t = e.target.nodeName.toLowerCase(); e.target.classList.contains("nodrag") || u(e.target, ".nodrag") || -1 !== ["input", "select", "textarea", "button", "a"].indexOf(t) ? (this.active = !1) : (e.preventDefault(), (e.target === this.el || ("img" !== t && u(e.target, ".gslide-inline"))) && ((this.active = !0), this.el.classList.add("dragging"), (this.dragContainer = u(e.target, ".ginner-container")))); } }, }, { key: "dragEnd", value: function(e) { var t = this; e && e.preventDefault(), (this.initialX = 0), (this.initialY = 0), (this.currentX = null), (this.currentY = null), (this.initialX = null), (this.initialY = null), (this.xOffset = 0), (this.yOffset = 0), (this.active = !1), this.doSlideChange && ((this.instance.preventOutsideClick = !0), "right" == this.doSlideChange && this.instance.prevSlide(), "left" == this.doSlideChange && this.instance.nextSlide()), this.doSlideClose && this.instance.close(), this.toleranceReached || this.setTranslate(this.dragContainer, 0, 0, !0), setTimeout(function() { (t.instance.preventOutsideClick = !1), (t.toleranceReached = !1), (t.lastDirection = null), (t.dragging = !1), (t.el.isDragging = !1), t.el.classList.remove("dragging"), t.slide.classList.remove("dragging-nav"), (t.dragContainer.style.transform = ""), (t.dragContainer.style.transition = ""); }, 100); }, }, { key: "drag", value: function(e) { if (this.active) { e.preventDefault(), this.slide.classList.add("dragging-nav"), "touchmove" === e.type ? ((this.currentX = e.touches[0].clientX - this.initialX), (this.currentY = e.touches[0].clientY - this.initialY)) : ((this.currentX = e.clientX - this.initialX), (this.currentY = e.clientY - this.initialY)), (this.xOffset = this.currentX), (this.yOffset = this.currentY), (this.el.isDragging = !0), (this.dragging = !0), (this.doSlideChange = !1), (this.doSlideClose = !1); var t = Math.abs(this.currentX), i = Math.abs(this.currentY); if ( t > 0 && t >= Math.abs(this.currentY) && (!this.lastDirection || "x" == this.lastDirection) ) { (this.yOffset = 0), (this.lastDirection = "x"), this.setTranslate(this.dragContainer, this.currentX, 0); var n = this.shouldChange(); if ( (!this.instance.settings.dragAutoSnap && n && (this.doSlideChange = n), this.instance.settings.dragAutoSnap && n) ) return ( (this.instance.preventOutsideClick = !0), (this.toleranceReached = !0), (this.active = !1), (this.instance.preventOutsideClick = !0), this.dragEnd(null), "right" == n && this.instance.prevSlide(), void("left" == n && this.instance.nextSlide()) ); } if ( this.toleranceY > 0 && i > 0 && i >= t && (!this.lastDirection || "y" == this.lastDirection) ) { (this.xOffset = 0), (this.lastDirection = "y"), this.setTranslate(this.dragContainer, 0, this.currentY); var s = this.shouldClose(); return (!this.instance.settings.dragAutoSnap && s && (this.doSlideClose = !0), void( this.instance.settings.dragAutoSnap && s && this.instance.close() ) ); } } }, }, { key: "shouldChange", value: function() { var e = !1; if (Math.abs(this.currentX) >= this.toleranceX) { var t = this.currentX > 0 ? "right" : "left"; (("left" == t && this.slide !== this.slide.parentNode.lastChild) || ("right" == t && this.slide !== this.slide.parentNode.firstChild)) && (e = t); } return e; }, }, { key: "shouldClose", value: function() { var e = !1; return Math.abs(this.currentY) >= this.toleranceY && (e = !0), e; }, }, { key: "setTranslate", value: function(e, t, i) { var n = arguments.length > 3 && void 0 !== arguments[3] && arguments[3]; (e.style.transition = n ? "all .2s ease" : ""), (e.style.transform = "translate3d(" .concat(t, "px, ") .concat(i, "px, 0)")); }, }, ]), e ); })(); function j(e, t, i, n) { var s = e.querySelector(".gslide-media"), l = new Image(), o = "gSlideTitle_" + i, r = "gSlideDesc_" + i; l.addEventListener( "load", function() { T(n) && n(); }, !1 ), (l.src = t.href), "" != t.sizes && "" != t.srcset && ((l.sizes = t.sizes), (l.srcset = t.srcset)), (l.alt = ""), I(t.alt) || "" === t.alt || (l.alt = t.alt), "" !== t.title && l.setAttribute("aria-labelledby", o), "" !== t.description && l.setAttribute("aria-describedby", r), t.hasOwnProperty("_hasCustomWidth") && t._hasCustomWidth && (l.style.width = t.width), t.hasOwnProperty("_hasCustomHeight") && t._hasCustomHeight && (l.style.height = t.height), s.insertBefore(l, s.firstChild); } function F(e, t, i, n) { var s = this, l = e.querySelector(".ginner-container"), o = "gvideo" + i, r = e.querySelector(".gslide-media"), a = this.getAllPlayers(); h(l, "gvideo-container"), r.insertBefore(m('
'), r.firstChild); var d = e.querySelector(".gvideo-wrapper"); S(this.settings.plyr.css, "Plyr"); var c = t.href, u = location.protocol.replace(":", ""), g = "", v = "", f = !1; "file" == u && (u = "http"), (r.style.maxWidth = t.width), S(this.settings.plyr.js, "Plyr", function() { if (c.match(/vimeo\.com\/([0-9]*)/)) { var l = /vimeo.*\/(\d+)/i.exec(c); (g = "vimeo"), (v = l[1]); } if ( c.match( /(youtube\.com|youtube-nocookie\.com)\/watch\?v=([a-zA-Z0-9\-_]+)/ ) || c.match(/youtu\.be\/([a-zA-Z0-9\-_]+)/) || c.match( /(youtube\.com|youtube-nocookie\.com)\/embed\/([a-zA-Z0-9\-_]+)/ ) ) { var r = (function(e) { var t = ""; t = void 0 !== (e = e .replace(/(>|<)/gi, "") .split(/(vi\/|v=|\/v\/|youtu\.be\/|\/embed\/)/))[2] ? (t = e[2].split(/[^0-9a-z_\-]/i))[0] : e; return t; })(c); (g = "youtube"), (v = r); } if (null !== c.match(/\.(mp4|ogg|webm|mov)$/)) { g = "local"; var u = '")); } var w = f || m( '') ); h(d, "".concat(g, "-video gvideo")), d.appendChild(w), d.setAttribute("data-id", o), d.setAttribute("data-index", i); var C = O(s.settings.plyr, "config") ? s.settings.plyr.config : {}, k = new Plyr("#" + o, C); k.on("ready", function(e) { var t = e.detail.plyr; (a[o] = t), T(n) && n(); }), b( function() { return ( e.querySelector("iframe") && "true" == e.querySelector("iframe").dataset.ready ); }, function() { s.resize(e); } ), k.on("enterfullscreen", R), k.on("exitfullscreen", R); }); } function R(e) { var t = u(e.target, ".gslide-media"); "enterfullscreen" == e.type && h(t, "fullscreen"), "exitfullscreen" == e.type && d(t, "fullscreen"); } function G(e, t, i, n) { var s, l = this, o = e.querySelector(".gslide-media"), r = !(!O(t, "href") || !t.href) && t.href.split("#").pop().trim(), d = !(!O(t, "content") || !t.content) && t.content; if ( d && (C(d) && (s = m('